package com.example.shopping.service;

import com.example.shopping.dao.ICommodityDao;
import com.example.shopping.pojo.Commodity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/*
Create by 苍狼 于 2020/1/16
站在巅峰看世界，
落在深渊思人生。
*/
@Service
public class CommodityServiceImpl implements CommodityService {
    @Autowired(required = false)
    private ICommodityDao commodityDao;

    @Override
    public List<Commodity> selectCommodityList() {
        return commodityDao.selectCommodityList();
    }

    @Override
    public List<Commodity> selectCommodityByLikeName(String name) {
        return commodityDao.selectCommodityByLikeName(name);
    }

    @Override
    public int deleteCommodityById(int id) {
        return commodityDao.deleteCommodityById(id);
    }

    @Override
    public List<Commodity> selectCommodityByStatus(int status) {
        return commodityDao.selectCommodityByStatus(status);
    }

}

